#include <stdio.h>

int sum_of_evens(int n) {
    int sum = 0;
    for (int i = 0; i <= n; i += 2) {
        sum += i;
    }
    return sum;
}
int main()
{
    int num;
    printf("请输入一个数：");
    scanf("%d",&num);
    if (num <= 0) {
        printf("输入必须是一个大于0的整数。\n");
        return 1;
    }
    int result = sum_of_evens(num);
    printf("0到%d之间所有偶数的和是: %d\n", num, result);
    
    return 0;
    
}